Characteristic mango price forecasting using combined deep-learning optimization model

Accurate product price forecasting is helpful for scientific decision-making and precise industrial planning. As a characteristic fruit that drives regional development, mango price prediction is of great significance to several economies. However, owing to the strong volatility of mango prices, forecasting is vulnerable to uncertainties and is very challenging. In this study, a deep-learning combination forecasting model based on a back-propagation (BP) long short-term memory (LSTM) neural network is proposed. Using daily mango price data from a large fruit wholesale trading center in China from January 2nd, 2014, to April 18th, 2022, mango price changes are learned and predicted to support the fruit industry. The results show that the root mean-square error, mean absolute percentage error, and the R2 determination coefficient of the BP-LSTM combination model are 0.0175, 0.14%, and 0.9998, respectively. The prediction results of the combined model are better than those of the separate BP and LSTM models. Furthermore, it best fits the actual price profile and has better generalizability.


Introduction
With the desire to improve living standards worldwide, the demand for fruit consumption continues to grow. Economically, fruits have a high price elasticity of demand, causing prices to fluctuate wildly and resulting in market instability. During the COVID-19 pandemic in particular, drastic fruit price fluctuations were frequent, and residential consumption was disrupted, which posed great challenges to fruit farmers and related enterprises. A consequential objective of understanding fruit price fluctuation rules is to alleviate the impact of imbalanced supplies and demand on the fruit market to some extent.
The mango is a common tropical and subtropical fruit and is the focus of this report. According to China's Bureau of Statistics, in 2021 the world's leading mango-producing regions included India, southern China, and Southeast Asian countries. Among these, India's annual output continues to be about 16.34M tons, accounting for about 42.2% of the world's total output. Southern China's 4.35M tons account for 11.2%, Thailand's 2.60M tons account for 6.5%, and The Philippines' amount accounts for 3.6%. As such, in these regions, mango production is a pillar industry with local characteristics, and these and other developing countries rely on developing industries. However, owing to many external factors, prices continue to fluctuate, resulting in adverse effects to mango producers, market operators, and consumers. Forecasting is the basis of decision-making, and making accurate price forecasts is crucial to industrial planning, development, and operations. Traditional methods either predict prices with strong subjectivity or excessively rely on linear pricing relationships, which results in low prediction accuracy [1]. Compared with traditional prediction methods, neural network methods in deep learning have proven to achieve better data prediction. Neural networks, with powerful nonlinear mapping capabilities, can fit data relationships more accurately. Our research uses daily mango prices of large fruit wholesale trading centers from January 2nd, 2014, to April 18th, 2022 as empirical data. According to the role of deep learning in forecasting problems, important features were extracted from high-dimensional data and the selected features were input into the neural network prediction model, and the BP-LSTM (back-propagation (BP) and long short-term memory (LSTM) neural-network combined model) neural network price forecasting combination model is proposed to forecast mango price. The purpose is to research the application of neural network prediction methods in the field of deep learning in the price prediction of characteristic agricultural products.
Based on BP neural network and LSTM neural network prediction methods, this paper proposes a combined optimization BP-LSMT neural network price prediction model for mango, a special fruit, which enriches the research methods in the field of characteristic agricultural products price prediction. This study fills a research gap pertaining to the lack of reliable mango price-prediction capability in existing agricultural models. Furthermore, the model is highly representative of the tropical and subtropical Asian regions.

Literature overview
Regional fruit price forecasting is commonplace, and it is crucial to business decision-making in those areas. According to the characteristics of various agricultural products, the type of forecasting can be either long-term [2] or short-term [3][4][5][6]. However, for fruits, it is mostly short-term, based on seasonality, periodicity, and perishability. The key quantitative analytical methods include econometric, statistical, intelligent analysis, and combined methods [7]. For example, the autoregressive integrated moving average (ARIMA) model, which extends the autoregressive moving average (ARMA) model, is widely used for agricultural econometric time-series forecasting. Tatarintsev et al. [8] established an ARIMA-based price-change prediction model for sugar crops, and Shyian et al. [9] did so for short-term milk price prediction. Hence, it is known to work. For fruit crops, Niu Guicao et al. [10] used an ARIMA model to make short-term price predictions of the Hebei pear.
Machine-learning capabilities now offer a variety of new and powerful forecasting techniques, particularly unsupervised deep-learning types. Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), and Deep Belief Networks are exemplary methods. Tasks of prediction, classification, and pattern recognition are routinely accomplished in many different fields with deep learning, and they have resulted in many benefits to science and society. This is particularly true for stock-price forecasting [11][12][13]. For example, Dong et al. [14] examined the stock-price predictability of the Hausdorff fractional gray model, which was built upon a CNN. Yu et al. [15] did the same using a locally linear embedding BP model. Hence, a deep-learning application for mango-specific agricultural product price prediction is overdue. The BP neural network (BPNN) is a classic model that has the characteristics of self-adaptation, -organization, and -learning. Li et al. [16] used a gray-type BPNN to predict the grain crop yield in Henan Province. Notably, BPNNs have unique advantages with their embedded stochastic gradient descent algorithm, which arrives at accurate predictions in the face of nearly random patterns. Long-term price predictions are also within the realm of the BPNN, particularly when applying weights to the multi-dimensional factors affecting price over time [17]. In addition to price forecasting tasks [18,19], BPNNs are often combined with other methods [20,21] to obtain even higher accuracy with other complicated problems.

PLOS ONE
The LSTM, first proposed by Hochreiter and Schmidhuber (1997), is a special RNN that comprehensively learns time-series information to make short-and long-term predictions. Ye et al. [22] constructed one for stock price forecasting based on an autoregressive synthetic moving average and combined it with a BPNN. LSTM models based on mean absolute error and mean-square error criteria tend to show high accuracy with time-series predictions. In terms of agricultural price forecasting, Fang Xueqing et al. [7] made short-term price forecasts for Fuji apples using the ensemble empirical mode decomposition LSTM, and Wang Xiaolei et al. [23] made apple price predictions based on an LSTM that used a generalized autoregressive conditional heteroskedasticity method. In terms of agricultural product price forecasting, it is important to note that the selection focus of forecasting methods has gradually shifted from traditional regression methods [24,25] to deep-learning models [26]. All of these examples support the potential of using deep learning to support the mango price prediction needs of our developing economies.

Research review
In this research, the Web-of-Science and Elsevier's EI databases were searched using "and" connectors for key terms, such as "agricultural products," "price forecasting," and "agricultural price forecast," and a total of 31 well-fitted journal articles were found. Unfortunately, most agricultural price forecasting publications focus on meat, vegetables, grains, etc. [27][28][29]. Therefore, we looked for model types and functional characteristics that could be extended to mango price prediction.

BPNN
The learning process of the BPNN combines forward and backward propagation (Fig 1). With forward propagation, information moves from the input layer to the hidden layer where it is processed. Then, it is transmitted to the output layer. If the output is not what is expected, an error signal is sent backwards to the input layer so that the next input can learn from the previous cycle. Hence, the error is gradually reduced by adjusting the weights between the layers.

Feed-forward neural network.
Given a (0) = x, the feed-forward propagation formula is as follows: a ðnÞ ¼ f n ðz ðnÞ Þ: From this, we obtain n is set as the number of neural-network layers, matching the number of neurons in the Nth layer. f n (�) is the activation function of the Nth layer, and w (n) is the corresponding weight matrix. b (n) as the bias value, z (n) is the net input (net activity value) of the neurons in the Nth layer, and a (n) is the output (activity value) of the layer's neuron. The entire network can be viewed as a composite function, φ = (x; w, b), and by taking vector X as the initial input, a (0) , information is transmitted layer-by-layer to obtain the active value of the entire function, a (N) , which includes the weights and biases of the network layer.

Feedback neural network.
Assuming that a given sample (x, y) is input into the neural network, stochastic gradient descent is used to learn the network parameters. Then, the network output isŷ. After the feed-forward calculation of the forward propagation is complete, back-propagation is performed, wherein the error terms for each layer, δ (n) , are cycled back to the input: For 8n; Parameters are then updated as follows: w ðnÞ ( W ðnÞ À aðd ðnÞ ða ðnÀ 1Þ T Þ þ lw ðnÞ Þ: ð6Þ When the error rate from the validation set no longer decreases, the trained weights, w, and biases, b, are the output. Above, L(�) is the loss function, δ (n) is the error term of the Nth layer, α is the learning rate, and λ is the regularization coefficient.

BPNN forecasting time-series model.
In this study, a single-step prediction is used for our BPNN data processing structure:

Core principles and computations of the LSTM
The input cycle and output mapping of an RNN at any given moment references all the data that have been processed until that moment, which results in a feedback network structure.
When training an RNN, if the gradient disappears easily, then the learning rate is probably set too low, and training is likely to fail. The LSTM is a variant of the RNN, and the main differences include cell structure and operations (Fig 2). The LSTM solves the phenomenon of gradient disappearance or explosion by introducing a gating mechanism, and an LSTM cell consists of an input gate, an oblivion gate, and an output gate. The LSTM network introduces a new internal state, C t 2R D , where C t is the state of the cell at time t, which is dedicated to linear cyclic information transfer. Nonlinear outputting information is aligned with the external state of the hidden layer.
where h t represents the external state of the hidden layer at time t, tanh is the activation function, andc t is the candidate state obtained nonlinearly. The oblivion gate, f t , determines the degree of influence of cell state C t−1 at moment (t−1) on cell state c t at the current moment, t: The weight matrix, w f , is multiplied by a matrix consisting of the previous and current moment values and a bias value, b f , which is processed by the activation function, σ, to obtain the result of the oblivion gate state calculation, f c .
The input gate, i t , determines the degree of influence of the current moment on state C t of the network input cell, X t : The input gate weight matrix, w i , is multiplied by a matrix consisting of the previous and current moment values and a bias value, b i , which is processed by the activation function, σ, to obtain the result of the input gate state calculation, i t .
The influence of the O t control unit status, c t , on the current output value, h t , is calculated as follows: At this point, the forward propagation process of the LSTM is complete.

BP-LSTM neural network
BPNNs have powerful nonlinear mapping capabilities, high self-learning and self-adaptability, good generalizability, and some fault tolerance. The three-layer version can approximate any nonlinear continuous function with arbitrary accuracy, which indicates that the BPNN is wellsuited to solving problems with complex internal mechanisms. LSTMs are also suitable for time-series problems. By combining the BPNN and LSTM, we apply a combined BP-LSTM to predict the prices of mangos. The main idea is like that of the gray neural network. In the BPNN, the input consists of a sample of variables, Xi, and labels, Y. The nonlinear relationship between the variables and labels is fitted and predicted by the BPNN. Hence, the time-series forecasting of multiple features is performed by the LSTM using the BPNN's data.

Model evaluation indicators
RMSE, MAPE, and the R 2 determination coefficient were used for the prediction accuracy evaluation [31]. The specific formulas are as follows: RMSE ¼ ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffi ffiffi 1 m Directional statistic (DS) is used for the directional forecasting accuracy of the competing models [32], defined as follows: Where F i = 1, if ðy iþ1 À y i Þ � ðŷ iþ1 À y t Þ � 0 otherwise and represent the total number of predictions. Obviously, the lower the RMSE and MAPE values, the higher the prediction accuracy is. In contrast, the higher the R 2 and DS values, the more accurate the direction prediction of the model. Next, we utilized the Diebold-Mariano (DM) statistic to compare the prediction errors of the two models [32]. Where

Empirical evidence and data analysis
This section reports on the accuracy and reliability measures of the proposed scheme as tested with a simulation. Performance comparisons were also made, and the results are provided.

Data processing
The raw daily mango price dataset was collected, but there were some missing values. Hence, linear interpolation was performed to fill the gaps. Afterwards, 3,029 total daily mango price data items were catalogued, and their price trends are shown in the

PLOS ONE
Characteristic mango price forecasting using combined deep-learning optimization model 4.2 Model predictions and data analysis 4.2.1 BPNN price forecasting. The BPNN structure consists of an input layer, an hidden layer, and an output layer. The input vector, X, is pre-processed to the hidden layer and then to the output layer to obtain the output vector, Y. The number of nodes in the hidden layer was set to 30; The training set consists of 80% of the data set, with the remaining 20% for testing. We tested the impact of various historical data on the prediction effect of the model in a comparative experiment to evaluate BPNN performance.
The smaller the value of RMSE and MAPE, the better, which means less error and more accurate. R 2 stands for goodness of fit, and a larger value of R 2 means a more suitable model. As shown in Table 1, Comprehensively compare the values of RMSE, MAPE and R 2 of models with different time lags, the training results obtained by setting the partial time lag of the BPNN for two were optimal.
As shown in Fig 4, the BPNN was a good fit and was hence used to predict the basic trend of the daily mango prices, with only a small number of points resulting in large errors. Overall, the prediction results were reliable.

LSTM price forecasting.
The graph in Fig 5 shows the response plots obtained by the LSTM alone for time-series forecasting. Overall, the fit was good; however, the first half of the training data had a relatively large error, meaning that there was room for refinement.

Combined BP-LSTM price forecasting.
The structure of the BP-LSTM model is shown in Fig 6. Various input nodes were selected according to their effects on BP model accuracy. As shown in Fig 7, two input nodes were found to be optimal. Historical Prices 1 and 2 were then input, and the BPNN performed single-step time series predictions. Then, based on the original input data, the BPNN's predicted values were fed to the LSTM for multiple-input price prediction.
Like the BPNN, the LSTM used 80% of the input data for training and 20% for the testing set. The network layers were generated using Matlab software, and the parameters were finetuned and optimized. Fig 8 provides a visualization of the BP-LSTM training process. Note that overfitting was suppressed by data normalization, operational standardization, and dropout layer application. There is no significant increase in the value of the loss function over time, indicating that the training process is good. BP-LSTM's RMSE was below 0.1 halfway through the iterative process, which is clearly better than the accuracy of the BPNN alone. Fig 9 shows the BP-LSTM model prediction results, indicating that the observed and predicted prices are very close. Fig 10 displays the BP-LSTM model test set prediction results, further demonstrating the accuracy of the model. Table 2 shows a comparison of the values used to test the model criteria.
As shown in Table 2, the combined BP-LSTM model achieved values of 0.0175 and 0.0014 for RMSE and MAPE, respectively, both of which are lower than those for the BPNN and LSTM alone. The BP-LSTM's R 2 value was 0.9998 higher than the values of 0.9888 and 0.9717 predicted by the BPNN and LSTM separately, indicating that the generalizability of the  combined BP-LSTM model is superior. Much of the improvement is traceable to the BPNN's network prediction stage. Notably, the amount of input data also affects the prediction results as too few input nodes will extract less information. However, too many nodes allow too much irregular information. Based on reasonable BPNN predictions, the LSTM can extract more features, which further improves the prediction accuracy. From Table 2, we can see that BP prediction model and BP-LSTM model are superior to LSTM model in the prediction level indicators RMSE, MAPE and goodness of fit parameter R 2 . Based on this, we further compare the performance of BP model and BP-LSTM model in terms of directional predictions. The directional predictions are more suitable for business purpose because the investors are more interested in the trend of the market.
As shown in Table 3, the DS test value of BP-LSTM model is greater than that of BP prediction model, indicating that BP-LSTM prediction model performs better than BP model in directional prediction.
As shown in Table 4, under different error measurement methods, the p-value of the model DM test is less than 0.05, indicating that the model prediction effect is significantly different. The DM value is greater than 0, indicating that the BP-LSTM model prediction result is significantly better than the BP model according to the test rules.
In conclusion, the BP-LSTM prediction model proposed in this study performs better than a single model.

Discussion
Price forecasting is a very meaningful thing that can help us make better behavioral decisions. From the economic point of view, price forecast can provide a basis for price decision and economic decision. From the perspective of agricultural product development, it is beneficial to make reasonable arrangement and adjustment of production to measure and judge the trend of price change. From the logistics perspective, adjust the logistics plan and reasonably arrange the logistics activities.
In the process of the reference study in the early stage of this study, we found that the predicted results of the price prediction model based on deep learning are generally better than the traditional price data prediction methods. With the deepening of research, a large number of combined forecasting models based on traditional forecasting methods and deep learning single forecasting model have emerged. These combined models can be roughly divided into two categories, one is the combination of traditional prediction methods and deep learning prediction models, and the other is the combination of different kinds of deep learning single prediction models. The modes of model combination include sequential combination, nesting and so on. Because the combined model combines the advantages and performance of multiple models, the combined model is generally superior to the single model in terms of forecasting performance. Based on this, we conducted a research on price prediction of characteristic agricultural products. We selected mangos with regional representation in China as the research object and proposed a new price prediction model for their price prediction, aiming at more accurate mango price prediction. To sum up, the contributions of this paper mainly include the following aspects. efficiency of agricultural products supply chain. Especially for the regional characteristic fruits used to support the development of the region, fruit price prediction is of great significance to guide the development of the fruit industry. However, there are few relevant studies at present, and the accuracy of traditional price prediction is poor. Under these conditions, researchers consider mango as the research carrier, combined with neural network prediction model to • Based on the daily price data collected for mangos, the average domestic price of mangoes in China is 10.56 RMB/kg, and the daily fluctuation falls within 5.6-16.6 RMB/kg. Notably, in China, the natural mango ripening season begins in July, at which time they are the least costly to cultivate, and they are in greater supply. Hence, according to the law of market prices, the daily price trend moves downward in July and lasts for a period of one or two months, followed by an upward trend in the nonripe season.
• Our BP-LSTM price prediction provided more accurate, one-step price predictions, and the results are judged to be useful in providing a basis for making short-term price decisions to reduce risks.
• Notably, the empirical data used in this paper originated from China, and their utility for making accurate predictions using the proposed BP-LSTM model is currently not generalizable outside of that region. Information from India should be examined next, using this tool BP-LSTM to check its wider application. Moreover, it has been noted that additional neural- network combinations may work better in different regions, which certainly makes efforts like this worthwhile in terms of enabling flexible decision-making with creative and representative modeling tools.